function disp_list = display_acqlist(acq_list);

% DISPLAY_ACQLIST - generates a cell array of acquisition strings
%
%    LIST = DISPLAY_ACQLIST(ACQ) generates a cell array LIST of
%    strings for the display of the acquisition parameters in the
%    acquisition list structure ACQ obtained from the subroutine
%    DATAC_NOTEFILE.

% By:   S.C. Molitor (smolitor@med.unc.edu)
% Date: March 3, 2000

% initialize outputs

disp_list = {};

% validate arguments

if (nargin ~= 1)
   msgbox('Invalid number of arguments', 'DISPLAY_ACQLIST Error', 'warn');
   return
elseif (~isstruct(acq_list) | isempty(acq_list))
   msgbox('LIST must be a structure', 'DISPLAY_ACQLIST Error', 'warn');
   return
end

% find number of digits in largest record for formatting

max_rec = max([acq_list(:).beg_rec acq_list(:).end_rec]);
num_digits = floor(log10(max_rec)) + 1;
num_fmt = int2str(num_digits);
rec_fmt = ['%0' num_fmt 'd-%0' num_fmt 'd: %s.stm'];

% loop through acquisition list

for i = 1 : length(acq_list)
   
   % initialize display string with acquisition information
   
   disp_str = sprintf(rec_fmt, acq_list(i).beg_rec, acq_list(i).end_rec, acq_list(i).stim_file);
   
   % add primary sequence info if it exists
   
   if (~isempty(acq_list(i).pri_seq))
      disp_str = [disp_str sprintf(' seq %d %s', acq_list(i).pri_chan, acq_list(i).pri_seq)];
   end
   
   % add secondary sequence info if it exists
   
   if (~isempty(acq_list(i).sec_seq))
      disp_str = [disp_str sprintf(' sec %d %s', acq_list(i).sec_chan, acq_list(i).sec_seq)];
   end
   
   % add acquisition mode & count
   % display values based on mode
   
   if (~isempty(find(strcmp(acq_list(i).acq_mode, {'ave', 'average'}))))
      disp_str = [disp_str sprintf(' %s %d', acq_list(i).acq_mode, acq_list(i).ave_cnt)];
   else
      disp_str = [disp_str sprintf(' %s %d', acq_list(i).acq_mode, acq_list(i).take_cnt)];
   end
   
   % add macro information if it exists
   
   if (~isempty(acq_list(i).macro_file))
      disp_str = [disp_str sprintf(' [MACRO %s%s]', acq_list(i).macro_file, acq_list(i).macro_args)];
   end
   
   % add display string to cell array
   
   disp_list{end + 1} = disp_str;
end
return
